package com.sugar.queryinfo.module.business.dal.mysql.dataqueryzwsc;

import java.util.*;

import com.sugar.queryinfo.framework.common.pojo.PageResult;
import com.sugar.queryinfo.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.sugar.queryinfo.framework.mybatis.core.mapper.BaseMapperX;
import com.sugar.queryinfo.module.business.dal.dataobject.dataqueryzwsc.DataQueryZwscDO;
import org.apache.ibatis.annotations.Mapper;
import com.sugar.queryinfo.module.business.controller.admin.dataqueryzwsc.vo.*;

/**
 * 数据查询-在网时长 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface DataQueryZwscMapper extends BaseMapperX<DataQueryZwscDO> {

    default PageResult<DataQueryZwscDO> selectPage(DataQueryZwscPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DataQueryZwscDO>()
                .eqIfPresent(DataQueryZwscDO::getUserId, reqVO.getUserId())
                .eqIfPresent(DataQueryZwscDO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(DataQueryZwscDO::getDataId, reqVO.getDataId())
                .betweenIfPresent(DataQueryZwscDO::getQueryTime, reqVO.getQueryTime())
                .betweenIfPresent(DataQueryZwscDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DataQueryZwscDO::getId));
    }

}